.DEFAULT_GOAL = rbuild

build:
	cmake . -Bbuild
	cd build && make

clean:
	rm -rf build dist

test_python: build
	PYTHONPATH=build/python python3 tests/test_python.py

rbuild: clean build run

test_java: build
	javac -cp build/xcomm/java/xspcomm/ -d build/xcomm/java/xspcomm/ build/xcomm/java/xspcomm/*.java
	javac -cp build/xcomm/java/xspcomm/ -d build/xcomm/java/xspcomm/ xcomm/tests/test_java.java
	java -Djava.library.path=build/xcomm/java/xspcomm/ -cp build/xcomm/java/xspcomm/ test_java